There has hitherto been known a magnetic sensor which utilizes a magnetoresistive element, such as a ferromagnetic magnetoresistive element (MR element), a giant magnetoresistive element (GMR element) or a tunnel magnetoresistive element (TMR element), as a magnetic field detecting element, and which, on the basis of a resistance value of the magnetoresistive element, generates an output value according to an external magnetic field acting on the magnetoresistive element.
The resistance value of a magnetoresistive element is dependent on temperature. Therefore, even when under a magnetic field of fixed magnitude, output value of the magnetic sensor varies with the temperature of the magnetoresistive element. Consequently, compensating this temperature dependence is an essential requirement for detecting (the magnitude of) a magnetic field with high precision.
A magnetic sensor apparatus described in Japanese Patent Application Laid-open (kokai) No. H06-77558 attains such compensation by means of a temperature sensor disposed adjacent to a magnetoresistive element. A relation between voltage, serving as an output value of the magnetic sensor, and temperature (temperature-dependent characteristic) is measured in advance and stored in a memory. Then, on the basis of an actual temperature detected by the temperature sensor and the relation stored in the memory, a reference voltage is determined, and a difference between an actual voltage output by the magnetic sensor and the determined reference voltage is amplified and output to thereby compensate the temperature-dependent characteristic of the magnetic sensor.
Meanwhile, the output value of a high sensitive magnetic sensor varies under an influence of geomagnetism, and geomagnetism varies with time. Consequently, the temperature-dependent characteristic stored in the memory of the above-mentioned magnetic sensor apparatus must to be measured within a predetermined short period of time in which geomagnetism is ensured not to change; and during the above-described measurement the magnetoresistive element must be heated or cooled within a short period of time.
However, if the above-mentioned magnetoresistive element is heated by an ordinary heating/cooling apparatus, not only the magnetoresistive element, but the entire magnetic sensor, including a substrate of the magnetoresistive element, is heated/cooled. Therefore, heating/cooling time would be long due to the large heat capacity of the magnetic sensor, and consequently geomagnetism would change during measurement of the temperature dependence. As a result, a problem would arise, in that the reliability of the temperature-dependent characteristic stored in the memory would be lowered, and consequently precise compensation of the temperature-dependent characteristic would be impossible. Although one feasible solution is to measure the temperature-dependent characteristic under an environment free from the influence of geomagnetism, an apparatus (magnetic field canceller) for establishing such environment is extremely expensive, thereby introducing another problem of increasing the manufacturing cost of the magnetic sensor.
Accordingly, an object of the present invention is to provide a magnetic sensor, which is capable of measuring a temperature-dependent characteristic inexpensively, within a short period of time, and with precision, and to provide a method for precisely compensating a temperature-dependent characteristic of a magnetic sensor.
Another object of the present invention is to provide a single-chip magnetic sensor which can generate an output signal of the magnetic sensor without using a connecting wire; e.g., an Au wire for connecting the magnetic sensor to external parts (for instance an external circuit).
Still another object of the present invention is to provide a magnetic sensor in which external noise exerts substantially no influence on a control circuit section which performs various operations such as generation of an output signal on the basis of a change in resistance of a magnetoresistive element, obtainment of data regarding the temperature characteristic of the magnetoresistive element, initialization of the magnetization of the free layer of the magnetoresistive element, and application of an external magnetic field to the magnetoresistive element for testing the performance of the magnetoresistive element.
A further object of the present invention is to provide a magnetic sensor having a structure suitable for fixing magnetization of pinned layers of a plurality of magnetoresistive elements in the same direction easily and reliably.